package com.example.demo.controller;

import com.example.demo.mapper.DynastysMapper;
import com.example.demo.utils.*;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/dynasty")
public class DynastyController {

    @Resource
    private DynastysMapper dynastysMapper;

    /*返回所有朝代*/
    @GetMapping("/allDynasty")
    public Result getAllDynasty() {
        List<String> list = dynastysMapper.getInitDynastysInfo();
        return Result.ok().data("list", list);
    }

}
